#ifndef __MEAS_H
#define	__MEAS_H

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "../define.h"		//include these headers
#include "global.h"
#include "aprcfgc.h"

void	calc_esd( void );
short	check_hue_item( item_s *itm, short cflg );
void	circuitry_break( void );
short	convtemp( void );
void	darkCalc( devinfo_s *dark, BOOL ch3 );
void	dlmdecode( long v1,long v2,long v3 );
void	force_off( void );
void	f_off( void );
BOOL	getch_dvcinfo3_com( short lgc_ch );
void	getHuedarkcalc( huep_s *h, devinfo_s *dark, BOOL ch3 );
void	huedecode( long v1 , long v2 );
long	hue_decode( short code);
long	hue_gaincalc( short gain, short range );
BOOL	item_judge( void );
BOOL	item_judge_hue_dlm( void );
BOOL	item_judge_nor( short sw );
void	measure_decode( devinfo_s *dark, short f, short ic );
void	ndecode( void );
void	normal_meas( void );
void	step_meas( short ino );
BOOL	hue_mas_meas( void );
BOOL	vl_mas1_meas( void );
BOOL	vl_mas2_meas( void );
BOOL	dl_mas_meas( void );
void	nor_circuitry_formation( void );
void	n_meas( short no );
void	oneitem_sequence( BOOL tflg );
BOOL	pol_judge( void );
void	setHuedarkcalc( huep_s *h, devinfo_s *dark, BOOL ch3 );
void	set_bias_set( void );
void	set_circuitry_code( void );
void	set_limit_set( void );
BOOL	set_measwait( long timer );
void	target_hue( Hue_cfg *trg, short ch );
void	task_meas( short );
void	vldecode( long v1  );
BOOL	mas_autorange( short *vd, short sc );
BOOL	mas_fullautorange(short *vd, short sc );
void	mas_autogain( short *val , short *gain );
void	cooldown_wait( double t );
void	force_hueoff( void );
BOOL	item_judge_dlm( void );

#endif		// __MEAS_H
